
def getCoin(M):
    # countFive=M//5
    # countTwo=(M-countFive*5)//2
    # countOne=(M-countFive*5-countTwo*2)//1
    # return "五元硬币的数量是{},两元硬币的数量是{},一元硬币的数量是{}".format(countFive, countTwo, countOne)
    ls=[5,2,1]

    sum=0
    for i in ls:
        x=M//i # i元硬币数量
        M=M%i # 更新总的金额
        sum+=x
        print(i,x)


def main():
    M=int(input())
    print(getCoin(M))


if __name__ == '__main__':
    main()